package jou.cs.mapper;

import jou.cs.entity.TComment;
import org.springframework.data.domain.Page;
import org.springframework.data.domain.Pageable;
import org.springframework.data.jpa.repository.JpaRepository;

import java.util.List;


public interface ComtRepository extends JpaRepository<TComment, Long> {
    // find all by user id
    List<TComment> findAllByUid(Long userId);
    //getCommentByUserIdAndPage
    Page<TComment> findAllByUid(Long userId, Pageable page);
    List<TComment> findAllByPidAndTid(Long pid, Long tid);
    Page<TComment> findAllByPid(Long pid, Pageable page);

    List<TComment> findAllByTid(Long tid, Pageable page);
}
